package com.cy.ppj.model.enums;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

import com.cy.ppj.model.vo.admin.commission.CommissionTypeVO;

import lombok.Getter;

public enum CommissionType {

    BORKER_USER("直推奖励", "客户{#customerName}（{#productName}）放款{#loanAmount}，返佣{#commissionRate}%"),
    TEAM("团队返佣", "{#borkerLevelName} {#userRealName} 的返佣，放款{#loanAmount}，返佣{#commissionRate}%"),
    DIAMOND_ALLOWANCE("钻石津贴", "钻石会员 {#userRealName} 的返佣，放款{#loanAmount}，返佣{#commissionRate}%"),

    BORKER_COMPANY("经纪人佣金-公司代收", "{#customerName}（{#productName}）放款{#loanAmount}，佣金率{#commissionRate}%"),
    COMPANY("公司统一收佣", "{#customerName}（{#productName}）放款{#loanAmount}，佣金率{#rate}%－经纪人：{#nickName}"),
    TEAM_FIRST("一级团队返佣", "来自一级成员{#nickName}的返佣，放款{#loanAmount}"),
    TEAM_SECOND("二级团队返佣", "来自二级成员{#nickName}的返佣，放款{#loanAmount}"),
    ;

    @Getter
    private String text;
    @Getter
    private String expression;

    CommissionType(String text, String expression) {
        this.text = text;
        this.expression = expression;
    }

    private static final List<CommissionTypeVO> voList;
    
    static {
    	voList = new ArrayList<>();
    	Stream.of(CommissionType.values()).forEach(c -> {
    		CommissionTypeVO vo = new CommissionTypeVO();
    		vo.setType(c);
    		vo.setTypeRemark(c.getText());
    		voList.add(vo);
    	});
    }
    
    public static List<CommissionTypeVO> getTypeList() {
    	return voList;
    }
}
